package com.atguigu.recursion;

/**
 * @author durant
 * @create 2021-11-13 11:29
 */
public class RecursionTest {
    public static void main(String[] args) {
        int result =factorial(5);
        System.out.println(result);
    }

    private static int factorial(int i) {
        if ( i == 1){
            return 1;
        }else{
            return i*factorial(i-1);
        }

    }
}
